<?php
// 获取历史完成任务
// header("content-type:text/html;charset=utf-8");
include_once("conn.php");

if(empty($_GET['searchway'])){
    $sql = "SELECT * FROM tb_fixinfo_request WHERE fix_status = '-1' OR fix_status = '2'";
}else{
    $pass;
}

$result = mysqli_query($conn_DB,$sql);
if ($result){
    if(mysqli_num_rows($result) <= 0){
        echo "<tr><td colspan='6'>暂无任务</td></tr>";
    }else{
        while($row = mysqli_fetch_object($result)){
            if($row->fix_status == '-1'){
                $status = "<td style='color:#fbe045'>用户撤销</td>";
            }else if($row->fix_status == '2'){
                $status = "<td style='color:green'>已完成</td>";
            }
            echo"
                <tr>
                    <td>".$row->fix_id."</td>
                    <td>".$row->u_id."</td>
                    <td>".$row->fix_name."</td>
                    <td>".$row->fix_sendtime."</td>
                    <td>".$row->fix_type."</td>".$status."
                    <td><a href='a-tasks-info.php?fix_id=".$row->fix_id."'>查看</a>
                </tr>
            ";
        }
    }
}